From a725d4c7d28fee701b6997cc46cffddefbcd26bf Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Wed, 30 Sep 2026 22:13:07 +0200 Subject: Allow granular routine frequencies like 5/2w --- src/routes/projects/[id]/+page.server.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/routes/projects/[id]/+page.server.ts') diff --git a/src/routes/projects/[id]/+page.server.ts b/src/routes/projects/[id]/+page.server.ts index 3321bcd..83d7571 100644 --- a/src/routes/projects/[id]/+page.server.ts +++ b/src/routes/projects/[id]/+page.server.ts @@ -9,11 +9,8 @@ import { loadArchived, } from '$lib/server/services/routines'; import { completeRoutineAction } from '$lib/server/services/routine-actions'; -import { - numericId, - parseFormString, - parseFrequencyDays, -} from '$lib/server/services/validation'; +import { numericId, parseFormString } from '$lib/server/services/validation'; +import { Frequency } from '$lib/shared/frequency'; import type { Actions, PageServerLoad } from './$types'; export const load: PageServerLoad = async ({ params }) => { @@ -44,7 +41,7 @@ export const actions: Actions = { await add( numericId(params.id), name, - parseFrequencyDays(data.get('frequencyDays')), + Frequency.parse(data.get('frequency')?.toString() ?? '').toSpec(), ); } catch { return fail(400, { error: 'Fréquence invalide' }); -- cgit v1.3